package com.company;

public class Main {

    public static void main(String[] args) {
        int [] a = {2,64,23,8,56,18,5};
        int max = a[0];
        int min = a[0];
        System.out.println("---int类型的数组---");
        for (int s : a){
            System.out.print(s+" ");
        }
        System.out.println("");
        System.out.println("-----华丽的分割线-----");
        for (int i=0;i<a.length;i++){
            if (max<a[i]){
                max=a[i];
            }
            if (min>a[i]){
                min=a[i];
            }
        }
        System.out.println("int类型的数组的最大值为："+max);
        System.out.println("int类型的数组的最小值为："+min);
    }
}


